from manimlib import*
import random as rd
import numpy as np

def normalize(f,to):
    return (to-f)/np.sqrt((f[0]-to[0])**2+(f[1]-to[1])**2)

def move(obj,target,t):
    obj.shift(normalize(obj.get_center(),target.get_center())*t)

class moving(VGroup):

    def __init__(self, sides, **kwargs):
        self.sides=sides
        super().__init__(self.get_points(),self.get_sides(),self.get_vecs(),**kwargs)
    
    def get_points(self):
        Dots=VGroup(*[Dot(coor,color=WHITE) for coor in RegularPolygon(self.sides,start_angle=PI/4).scale(2).get_vertices()])
        return Dots
    
    def get_sides(self):
        t=RegularPolygon(self.sides,start_angle=PI/4,stroke_width=1).scale(2).get_vertices()
        Sides=VGroup(*[Line(t[i],t[(i+1)%len(t)],color=GREY_A) for i in range(0,len(t))])
        return Sides

    def get_vecs(self):
        vec=VGroup(*[Arrow(line.get_start(),line.get_start()+line.get_unit_vector(),buff=0,stroke_width=1).set_color(YELLOW) for line in self.get_sides()])
        return vec
    
def update0(movings):
    for i,dot in enumerate(movings[0]):
        def up1(obj,t):
            move(obj,movings[0][(i+1) % movings.sides],t)
        dot.add_updater(up1)
    for i,line in enumerate(movings[1]):
        def up2(obj):
            obj.put_start_and_end_on(movings[0][i].get_center(),movings[0][(i+1) % movings.sides].get_center())
        line.add_updater(up2)
    for i,vec in enumerate(movings[2]):
        def up3(obj):
            obj.put_start_and_end_on(movings[1][i].get_start(),movings[1][i].get_start()+movings[1][i].get_unit_vector())
        vec.add_updater(up3)

def reverse(x):
    return smooth(1-x)

class Disappear(GrowFromCenter):
    CONFIG={
        "rate_func":reverse
    }

class pic(Scene):
    def construct(self):
        a=moving(4)
        self.add(a[0],a[1],a[2])
class testing(Scene):
    def construct(self):
        intro_list=["这是一个有趣的问题","我会给大家几天时间思考","已经想出来的同学请不要剧透","我将在几天之后把答案放在p2"]
        intro_vg=VGroup(*[Text(text) for text in intro_list]).scale(0.75)
        self.play(GrowFromCenter(intro_vg[0]),run_time=2)
        for i in range(3):
            self.wait(4)
            self.play(GrowFromCenter(intro_vg[i+1]),GrowFromCenter(intro_vg[i],rate_func=reverse),run_time=2)
        self.wait(4)
        self.play(GrowFromCenter(intro_vg[3],rate_func=reverse),run_time=2)
        a=moving(4)
        a00=a[0][0].copy()
        a01=a[0][1].copy()
        a02=a[0][2].copy()
        a03=a[0][3].copy()
        a10=a[1][0].copy()
        a11=a[1][1].copy()
        a12=a[1][2].copy()
        a13=a[1][3].copy()
        a20=a[2][0].copy()
        a21=a[2][1].copy()
        a22=a[2][2].copy()
        a23=a[2][3].copy()
        for i in [a00,a01,a02,a03,a10,a11,a12,a13,a20,a21,a22,a23]:
            i.save_state()
        tex=Tex("a").next_to(a12,DOWN)
        #self.add(a00,a01,a02,a03,a10,a11,a12,a13,a20,a21,a22,a23,)
        text_list=["这有四个点","它们组成一个边长为a的正方形","它们按如图方式匀速运动","我们把其中一个点的轨迹描出","问这条轨迹的长度是多少？为什么？"]
        text_vg=VGroup(*[Text(text) for text in text_list]).scale(0.75).to_edge(DOWN)
        self.play(*[Write(dot) for dot in [a00,a01,a02,a03]])
        self.play(Write(text_vg[0]))

        self.play(*[ShowCreation(line) for line in [a10,a11,a12,a13]],Write(tex))
        self.play(Write(text_vg[1]),Disappear(text_vg[0]))

        self.play(*[GrowArrow(arrow) for arrow in [a20,a21,a22,a23]],Disappear(tex))
        self.play(Write(text_vg[2]),Disappear(text_vg[1]))
        
        a00.add_updater(lambda obj,dt:move(obj,a01,dt))
        a01.add_updater(lambda obj,dt:move(obj,a02,dt))
        a02.add_updater(lambda obj,dt:move(obj,a03,dt))
        a03.add_updater(lambda obj,dt:move(obj,a00,dt))
        a10.add_updater(lambda obj:obj.put_start_and_end_on(a00.get_center(),a01.get_center()))
        a11.add_updater(lambda obj:obj.put_start_and_end_on(a01.get_center(),a02.get_center()))
        a12.add_updater(lambda obj:obj.put_start_and_end_on(a02.get_center(),a03.get_center()))
        a13.add_updater(lambda obj:obj.put_start_and_end_on(a03.get_center(),a00.get_center()))
        a20.add_updater(lambda obj:obj.put_start_and_end_on(a10.get_start(),a10.get_start()+a10.get_unit_vector()))
        a21.add_updater(lambda obj:obj.put_start_and_end_on(a11.get_start(),a11.get_start()+a11.get_unit_vector()))
        a22.add_updater(lambda obj:obj.put_start_and_end_on(a12.get_start(),a12.get_start()+a12.get_unit_vector()))
        a23.add_updater(lambda obj:obj.put_start_and_end_on(a13.get_start(),a13.get_start()+a13.get_unit_vector()))


        
        a00.clear_updaters()
        a01.clear_updaters()
        a02.clear_updaters()
        a03.clear_updaters()
        a10.clear_updaters()
        a11.clear_updaters()
        a12.clear_updaters()
        a13.clear_updaters()
        a20.clear_updaters()
        a21.clear_updaters()
        a22.clear_updaters()
        a23.clear_updaters()



        self.play(*[obj.restore for obj in [a00,a01,a02,a03,a10,a11,a12,a13,a20,a21,a22,a23,]])
        self.play(Write(text_vg[3]),Disappear(text_vg[2]))
        Trace=TracedPath(a02.get_center,min_distance_to_new_point=0.01).set_color(RED_A)
        self.add(Trace,)
        a00.add_updater(lambda obj,dt:move(obj,a01,dt))
        a01.add_updater(lambda obj,dt:move(obj,a02,dt))
        a02.add_updater(lambda obj,dt:move(obj,a03,dt))
        a03.add_updater(lambda obj,dt:move(obj,a00,dt))
        a10.add_updater(lambda obj:obj.put_start_and_end_on(a00.get_center(),a01.get_center()))
        a11.add_updater(lambda obj:obj.put_start_and_end_on(a01.get_center(),a02.get_center()))
        a12.add_updater(lambda obj:obj.put_start_and_end_on(a02.get_center(),a03.get_center()))
        a13.add_updater(lambda obj:obj.put_start_and_end_on(a03.get_center(),a00.get_center()))
        a20.add_updater(lambda obj:obj.put_start_and_end_on(a10.get_start(),a10.get_start()+a10.get_unit_vector()))
        a21.add_updater(lambda obj:obj.put_start_and_end_on(a11.get_start(),a11.get_start()+a11.get_unit_vector()))
        a22.add_updater(lambda obj:obj.put_start_and_end_on(a12.get_start(),a12.get_start()+a12.get_unit_vector()))
        a23.add_updater(lambda obj:obj.put_start_and_end_on(a13.get_start(),a13.get_start()+a13.get_unit_vector()))
        self.wait(2*1.41)
        
        a00.clear_updaters()
        a01.clear_updaters()
        a02.clear_updaters()
        a03.clear_updaters()
        a10.clear_updaters()
        a11.clear_updaters()
        a12.clear_updaters()
        a13.clear_updaters()
        a20.clear_updaters()
        a21.clear_updaters()
        a22.clear_updaters()
        a23.clear_updaters()
        Trace.clear_updaters()


        self.play(*[obj.restore for obj in [a00,a01,a02,a03,a10,a11,a12,a13,a20,a21,a22,a23,]])
        self.play(Write(text_vg[4]),Disappear(text_vg[3]))
class test(Scene):
    def construct(self):
        circle=Circle(arc_center=LEFT)
        frame=self.camera.frame
        self.play(Write(circle))
        self.play(frame.shift,UP)
class solution(Scene):
    CONFIG={
        "camera_class":ThreeDCamera
    }
    def construct(self):
        a=moving(4)
        a00=a[0][0].copy()
        a01=a[0][1].copy()
        a02=a[0][2].copy().set_color(RED)
        a03=a[0][3].copy().set_color(BLUE)
        a10=a[1][0].copy()
        a11=a[1][1].copy()
        a12=a[1][2].copy()
        a13=a[1][3].copy()
        a20=a[2][0].copy()
        a21=a[2][1].copy()
        a22=a[2][2].copy()
        a23=a[2][3].copy()
        for i in [a00,a01,a02,a03,a10,a11,a12,a13,a20,a21,a22,a23]:
            i.save_state()
        grid=NumberPlane().set_color("#222222")
        self.add(grid)
        frame=self.camera.frame
        #self.add(a00,a01,a02,a03,a10,a11,a12,a13,a20,a21,a22,a23,)
        tex=Tex("a").next_to(a12,DOWN).set_color(GREY_A)
        self.play(*[Write(dot) for dot in [a00,a01,a02,a03]])
        self.play(*[ShowCreation(line) for line in [a10,a11,a12,a13]],Write(tex))
        self.play(*[GrowArrow(arrow) for arrow in [a20,a21,a22,a23]])
        self.wait(2)
        def update(t):
            a00.add_updater(lambda obj,dt:move(obj,a01,t))
            a01.add_updater(lambda obj,dt:move(obj,a02,t))
            a02.add_updater(lambda obj,dt:move(obj,a03,t))
            a03.add_updater(lambda obj,dt:move(obj,a00,t))
            a10.add_updater(lambda obj:obj.put_start_and_end_on(a00.get_center(),a01.get_center()))
            a11.add_updater(lambda obj:obj.put_start_and_end_on(a01.get_center(),a02.get_center()))
            a12.add_updater(lambda obj:obj.put_start_and_end_on(a02.get_center(),a03.get_center()))
            a13.add_updater(lambda obj:obj.put_start_and_end_on(a03.get_center(),a00.get_center()))
            a20.add_updater(lambda obj:obj.put_start_and_end_on(a10.get_start(),a10.get_start()+a10.get_unit_vector()))
            a21.add_updater(lambda obj:obj.put_start_and_end_on(a11.get_start(),a11.get_start()+a11.get_unit_vector()))
            a22.add_updater(lambda obj:obj.put_start_and_end_on(a12.get_start(),a12.get_start()+a12.get_unit_vector()))
            a23.add_updater(lambda obj:obj.put_start_and_end_on(a13.get_start(),a13.get_start()+a13.get_unit_vector()))
        def clear():
            a00.clear_updaters()
            a01.clear_updaters()
            a02.clear_updaters()
            a03.clear_updaters()
            a10.clear_updaters()
            a11.clear_updaters()
            a12.clear_updaters()
            a13.clear_updaters()
            a20.clear_updaters()
            a21.clear_updaters()
            a22.clear_updaters()
            a23.clear_updaters()
        def restore():
            self.play(*[obj.restore for obj in [a00,a01,a02,a03,a10,a11,a12,a13,a20,a21,a22,a23,]])
        update(1/60)
        self.wait(2*1.4)
        clear()
        self.wait(1)
        restore()
        self.wait(2)
        frame.save_state()
        tex.save_state()
        v=Tex("v").next_to(a22.get_end(),UP).set_color(YELLOW)
        v.save_state()
        self.play(frame.scale,0.5,frame.move_to,a03)
        self.play(Write(v))
        self.wait(2)
        def movingframe(obj):
            obj.restore()
            obj.set_euler_angles(theta=a12.get_angle()).scale(0.5).move_to(a03)
        
        Original_line=a12.copy()
        Original_line.add_updater(lambda obj:obj.put_start_and_end_on(a03.get_center(),a03.get_center()-a12.get_unit_vector()*2*np.sqrt(2)))
        def lengthlabel(obj):
            obj.restore()
            obj.next_to(Original_line.get_center(),DOWN).rotate(a12.get_angle(),about_point=Original_line.get_center())
        self.add(Original_line)
        self.bring_to_back(Original_line)
        def velocitylabel(obj):
            obj.restore()
            obj.next_to(a22.get_end(),UP).rotate(a12.get_angle(),about_point=a22.get_end())
        frame.add_updater(movingframe)
        tex.add_updater(lengthlabel)
        v.add_updater(velocitylabel)

        Trace=TracedPath(a02.get_center,min_distance_to_new_point=0.01).set_color(RED_A)
        self.add(Trace)
        update(1/240)
        self.wait(8*1.4)
        clear()
        Trace.clear_updaters()
        v.clear_updaters()
        tex.clear_updaters()
        frame.clear_updaters()
        formula1=Tex("t={ a \\over v }",isolate=["\\over","="]).rotate(a12.get_angle()).next_to(Original_line,LEFT)
        formula2=Tex("s={ a \\over v }\\times v",isolate=["\\over","=","\\times"]).to_edge(UP)
        formula3=Tex("s=a",isolate=["="]).to_edge(UP)
        self.wait(2)
        self.play(TransformFromCopy(tex[0],formula1[2]),TransformFromCopy(v,formula1[-1]),FadeIn(formula1[0:2]),FadeIn(formula1[3]))
        self.wait(2)
        self.play(*[obj.animate.restore() for obj in [a00,a01,a02,a03,a10,a11,a12,a13,a20,a21,a22,a23,tex,v,Original_line,frame]],TransformMatchingTex(formula1,formula2))
        self.wait(2)
        self.play(TransformMatchingTex(formula2,formula3))
        self.wait(2)

class hundred_gon(Scene):
    def construct(self):
        a=moving(100)
        a00=a[0][0].copy()
        a01=a[0][1].copy()
        a02=a[0][2].copy()
        a03=a[0][3].copy()
        a04=a[0][4].copy()
        a05=a[0][5].copy()
        a06=a[0][6].copy()
        a07=a[0][7].copy()
        a08=a[0][8].copy()
        a09=a[0][9].copy()
        a010=a[0][10].copy()
        a011=a[0][11].copy()
        a012=a[0][12].copy()
        a013=a[0][13].copy()
        a014=a[0][14].copy()
        a015=a[0][15].copy()
        a016=a[0][16].copy()
        a017=a[0][17].copy()
        a018=a[0][18].copy()
        a019=a[0][19].copy()
        a020=a[0][20].copy()
        a021=a[0][21].copy()
        a022=a[0][22].copy()
        a023=a[0][23].copy()
        a024=a[0][24].copy()
        a025=a[0][25].copy()
        a026=a[0][26].copy()
        a027=a[0][27].copy()
        a028=a[0][28].copy()
        a029=a[0][29].copy()
        a030=a[0][30].copy()
        a031=a[0][31].copy()
        a032=a[0][32].copy()
        a033=a[0][33].copy()
        a034=a[0][34].copy()
        a035=a[0][35].copy()
        a036=a[0][36].copy()
        a037=a[0][37].copy()
        a038=a[0][38].copy()
        a039=a[0][39].copy()
        a040=a[0][40].copy()
        a041=a[0][41].copy()
        a042=a[0][42].copy()
        a043=a[0][43].copy()
        a044=a[0][44].copy()
        a045=a[0][45].copy()
        a046=a[0][46].copy()
        a047=a[0][47].copy()
        a048=a[0][48].copy()
        a049=a[0][49].copy()
        a050=a[0][50].copy()
        a051=a[0][51].copy()
        a052=a[0][52].copy()
        a053=a[0][53].copy()
        a054=a[0][54].copy()
        a055=a[0][55].copy()
        a056=a[0][56].copy()
        a057=a[0][57].copy()
        a058=a[0][58].copy()
        a059=a[0][59].copy()
        a060=a[0][60].copy()
        a061=a[0][61].copy()
        a062=a[0][62].copy()
        a063=a[0][63].copy()
        a064=a[0][64].copy()
        a065=a[0][65].copy()
        a066=a[0][66].copy()
        a067=a[0][67].copy()
        a068=a[0][68].copy()
        a069=a[0][69].copy()
        a070=a[0][70].copy()
        a071=a[0][71].copy()
        a072=a[0][72].copy()
        a073=a[0][73].copy()
        a074=a[0][74].copy()
        a075=a[0][75].copy()
        a076=a[0][76].copy()
        a077=a[0][77].copy()
        a078=a[0][78].copy()
        a079=a[0][79].copy()
        a080=a[0][80].copy()
        a081=a[0][81].copy()
        a082=a[0][82].copy()
        a083=a[0][83].copy()
        a084=a[0][84].copy()
        a085=a[0][85].copy()
        a086=a[0][86].copy()
        a087=a[0][87].copy()
        a088=a[0][88].copy()
        a089=a[0][89].copy()
        a090=a[0][90].copy()
        a091=a[0][91].copy()
        a092=a[0][92].copy()
        a093=a[0][93].copy()
        a094=a[0][94].copy()
        a095=a[0][95].copy()
        a096=a[0][96].copy()
        a097=a[0][97].copy()
        a098=a[0][98].copy()
        a099=a[0][99].copy()
        a10=a[1][0].copy()
        a11=a[1][1].copy()
        a12=a[1][2].copy()
        a13=a[1][3].copy()
        a14=a[1][4].copy()
        a15=a[1][5].copy()
        a16=a[1][6].copy()
        a17=a[1][7].copy()
        a18=a[1][8].copy()
        a19=a[1][9].copy()
        a110=a[1][10].copy()
        a111=a[1][11].copy()
        a112=a[1][12].copy()
        a113=a[1][13].copy()
        a114=a[1][14].copy()
        a115=a[1][15].copy()
        a116=a[1][16].copy()
        a117=a[1][17].copy()
        a118=a[1][18].copy()
        a119=a[1][19].copy()
        a120=a[1][20].copy()
        a121=a[1][21].copy()
        a122=a[1][22].copy()
        a123=a[1][23].copy()
        a124=a[1][24].copy()
        a125=a[1][25].copy()
        a126=a[1][26].copy()
        a127=a[1][27].copy()
        a128=a[1][28].copy()
        a129=a[1][29].copy()
        a130=a[1][30].copy()
        a131=a[1][31].copy()
        a132=a[1][32].copy()
        a133=a[1][33].copy()
        a134=a[1][34].copy()
        a135=a[1][35].copy()
        a136=a[1][36].copy()
        a137=a[1][37].copy()
        a138=a[1][38].copy()
        a139=a[1][39].copy()
        a140=a[1][40].copy()
        a141=a[1][41].copy()
        a142=a[1][42].copy()
        a143=a[1][43].copy()
        a144=a[1][44].copy()
        a145=a[1][45].copy()
        a146=a[1][46].copy()
        a147=a[1][47].copy()
        a148=a[1][48].copy()
        a149=a[1][49].copy()
        a150=a[1][50].copy()
        a151=a[1][51].copy()
        a152=a[1][52].copy()
        a153=a[1][53].copy()
        a154=a[1][54].copy()
        a155=a[1][55].copy()
        a156=a[1][56].copy()
        a157=a[1][57].copy()
        a158=a[1][58].copy()
        a159=a[1][59].copy()
        a160=a[1][60].copy()
        a161=a[1][61].copy()
        a162=a[1][62].copy()
        a163=a[1][63].copy()
        a164=a[1][64].copy()
        a165=a[1][65].copy()
        a166=a[1][66].copy()
        a167=a[1][67].copy()
        a168=a[1][68].copy()
        a169=a[1][69].copy()
        a170=a[1][70].copy()
        a171=a[1][71].copy()
        a172=a[1][72].copy()
        a173=a[1][73].copy()
        a174=a[1][74].copy()
        a175=a[1][75].copy()
        a176=a[1][76].copy()
        a177=a[1][77].copy()
        a178=a[1][78].copy()
        a179=a[1][79].copy()
        a180=a[1][80].copy()
        a181=a[1][81].copy()
        a182=a[1][82].copy()
        a183=a[1][83].copy()
        a184=a[1][84].copy()
        a185=a[1][85].copy()
        a186=a[1][86].copy()
        a187=a[1][87].copy()
        a188=a[1][88].copy()
        a189=a[1][89].copy()
        a190=a[1][90].copy()
        a191=a[1][91].copy()
        a192=a[1][92].copy()
        a193=a[1][93].copy()
        a194=a[1][94].copy()
        a195=a[1][95].copy()
        a196=a[1][96].copy()
        a197=a[1][97].copy()
        a198=a[1][98].copy()
        a199=a[1][99].copy()
        a20=a[2][0].copy()
        a21=a[2][1].copy()
        a22=a[2][2].copy()
        a23=a[2][3].copy()
        a24=a[2][4].copy()
        a25=a[2][5].copy()
        a26=a[2][6].copy()
        a27=a[2][7].copy()
        a28=a[2][8].copy()
        a29=a[2][9].copy()
        a210=a[2][10].copy()
        a211=a[2][11].copy()
        a212=a[2][12].copy()
        a213=a[2][13].copy()
        a214=a[2][14].copy()
        a215=a[2][15].copy()
        a216=a[2][16].copy()
        a217=a[2][17].copy()
        a218=a[2][18].copy()
        a219=a[2][19].copy()
        a220=a[2][20].copy()
        a221=a[2][21].copy()
        a222=a[2][22].copy()
        a223=a[2][23].copy()
        a224=a[2][24].copy()
        a225=a[2][25].copy()
        a226=a[2][26].copy()
        a227=a[2][27].copy()
        a228=a[2][28].copy()
        a229=a[2][29].copy()
        a230=a[2][30].copy()
        a231=a[2][31].copy()
        a232=a[2][32].copy()
        a233=a[2][33].copy()
        a234=a[2][34].copy()
        a235=a[2][35].copy()
        a236=a[2][36].copy()
        a237=a[2][37].copy()
        a238=a[2][38].copy()
        a239=a[2][39].copy()
        a240=a[2][40].copy()
        a241=a[2][41].copy()
        a242=a[2][42].copy()
        a243=a[2][43].copy()
        a244=a[2][44].copy()
        a245=a[2][45].copy()
        a246=a[2][46].copy()
        a247=a[2][47].copy()
        a248=a[2][48].copy()
        a249=a[2][49].copy()
        a250=a[2][50].copy()
        a251=a[2][51].copy()
        a252=a[2][52].copy()
        a253=a[2][53].copy()
        a254=a[2][54].copy()
        a255=a[2][55].copy()
        a256=a[2][56].copy()
        a257=a[2][57].copy()
        a258=a[2][58].copy()
        a259=a[2][59].copy()
        a260=a[2][60].copy()
        a261=a[2][61].copy()
        a262=a[2][62].copy()
        a263=a[2][63].copy()
        a264=a[2][64].copy()
        a265=a[2][65].copy()
        a266=a[2][66].copy()
        a267=a[2][67].copy()
        a268=a[2][68].copy()
        a269=a[2][69].copy()
        a270=a[2][70].copy()
        a271=a[2][71].copy()
        a272=a[2][72].copy()
        a273=a[2][73].copy()
        a274=a[2][74].copy()
        a275=a[2][75].copy()
        a276=a[2][76].copy()
        a277=a[2][77].copy()
        a278=a[2][78].copy()
        a279=a[2][79].copy()
        a280=a[2][80].copy()
        a281=a[2][81].copy()
        a282=a[2][82].copy()
        a283=a[2][83].copy()
        a284=a[2][84].copy()
        a285=a[2][85].copy()
        a286=a[2][86].copy()
        a287=a[2][87].copy()
        a288=a[2][88].copy()
        a289=a[2][89].copy()
        a290=a[2][90].copy()
        a291=a[2][91].copy()
        a292=a[2][92].copy()
        a293=a[2][93].copy()
        a294=a[2][94].copy()
        a295=a[2][95].copy()
        a296=a[2][96].copy()
        a297=a[2][97].copy()
        a298=a[2][98].copy()
        a299=a[2][99].copy()
        self.add(a00,a01,a02,a03,a04,a05,a06,a07,a08,a09,a010,a011,a012,a013,a014,a015,a016,a017,a018,a019,a020,a021,a022,a023,a024,a025,a026,a027,a028,a029,a030,a031,a032,a033,a034,a035,a036,a037,a038,a039,a040,a041,a042,a043,a044,a045,a046,a047,a048,a049,a050,a051,a052,a053,a054,a055,a056,a057,a058,a059,a060,a061,a062,a063,a064,a065,a066,a067,a068,a069,a070,a071,a072,a073,a074,a075,a076,a077,a078,a079,a080,a081,a082,a083,a084,a085,a086,a087,a088,a089,a090,a091,a092,a093,a094,a095,a096,a097,a098,a099,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a110,a111,a112,a113,a114,a115,a116,a117,a118,a119,a120,a121,a122,a123,a124,a125,a126,a127,a128,a129,a130,a131,a132,a133,a134,a135,a136,a137,a138,a139,a140,a141,a142,a143,a144,a145,a146,a147,a148,a149,a150,a151,a152,a153,a154,a155,a156,a157,a158,a159,a160,a161,a162,a163,a164,a165,a166,a167,a168,a169,a170,a171,a172,a173,a174,a175,a176,a177,a178,a179,a180,a181,a182,a183,a184,a185,a186,a187,a188,a189,a190,a191,a192,a193,a194,a195,a196,a197,a198,a199,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a210,a211,a212,a213,a214,a215,a216,a217,a218,a219,a220,a221,a222,a223,a224,a225,a226,a227,a228,a229,a230,a231,a232,a233,a234,a235,a236,a237,a238,a239,a240,a241,a242,a243,a244,a245,a246,a247,a248,a249,a250,a251,a252,a253,a254,a255,a256,a257,a258,a259,a260,a261,a262,a263,a264,a265,a266,a267,a268,a269,a270,a271,a272,a273,a274,a275,a276,a277,a278,a279,a280,a281,a282,a283,a284,a285,a286,a287,a288,a289,a290,a291,a292,a293,a294,a295,a296,a297,a298,a299,)
        a00.add_updater(lambda obj,dt:move(obj,a01,dt))
        a01.add_updater(lambda obj,dt:move(obj,a02,dt))
        a02.add_updater(lambda obj,dt:move(obj,a03,dt))
        a03.add_updater(lambda obj,dt:move(obj,a04,dt))
        a04.add_updater(lambda obj,dt:move(obj,a05,dt))
        a05.add_updater(lambda obj,dt:move(obj,a06,dt))
        a06.add_updater(lambda obj,dt:move(obj,a07,dt))
        a07.add_updater(lambda obj,dt:move(obj,a08,dt))
        a08.add_updater(lambda obj,dt:move(obj,a09,dt))
        a09.add_updater(lambda obj,dt:move(obj,a010,dt))
        a010.add_updater(lambda obj,dt:move(obj,a011,dt))
        a011.add_updater(lambda obj,dt:move(obj,a012,dt))
        a012.add_updater(lambda obj,dt:move(obj,a013,dt))
        a013.add_updater(lambda obj,dt:move(obj,a014,dt))
        a014.add_updater(lambda obj,dt:move(obj,a015,dt))
        a015.add_updater(lambda obj,dt:move(obj,a016,dt))
        a016.add_updater(lambda obj,dt:move(obj,a017,dt))
        a017.add_updater(lambda obj,dt:move(obj,a018,dt))
        a018.add_updater(lambda obj,dt:move(obj,a019,dt))
        a019.add_updater(lambda obj,dt:move(obj,a020,dt))
        a020.add_updater(lambda obj,dt:move(obj,a021,dt))
        a021.add_updater(lambda obj,dt:move(obj,a022,dt))
        a022.add_updater(lambda obj,dt:move(obj,a023,dt))
        a023.add_updater(lambda obj,dt:move(obj,a024,dt))
        a024.add_updater(lambda obj,dt:move(obj,a025,dt))
        a025.add_updater(lambda obj,dt:move(obj,a026,dt))
        a026.add_updater(lambda obj,dt:move(obj,a027,dt))
        a027.add_updater(lambda obj,dt:move(obj,a028,dt))
        a028.add_updater(lambda obj,dt:move(obj,a029,dt))
        a029.add_updater(lambda obj,dt:move(obj,a030,dt))
        a030.add_updater(lambda obj,dt:move(obj,a031,dt))
        a031.add_updater(lambda obj,dt:move(obj,a032,dt))
        a032.add_updater(lambda obj,dt:move(obj,a033,dt))
        a033.add_updater(lambda obj,dt:move(obj,a034,dt))
        a034.add_updater(lambda obj,dt:move(obj,a035,dt))
        a035.add_updater(lambda obj,dt:move(obj,a036,dt))
        a036.add_updater(lambda obj,dt:move(obj,a037,dt))
        a037.add_updater(lambda obj,dt:move(obj,a038,dt))
        a038.add_updater(lambda obj,dt:move(obj,a039,dt))
        a039.add_updater(lambda obj,dt:move(obj,a040,dt))
        a040.add_updater(lambda obj,dt:move(obj,a041,dt))
        a041.add_updater(lambda obj,dt:move(obj,a042,dt))
        a042.add_updater(lambda obj,dt:move(obj,a043,dt))
        a043.add_updater(lambda obj,dt:move(obj,a044,dt))
        a044.add_updater(lambda obj,dt:move(obj,a045,dt))
        a045.add_updater(lambda obj,dt:move(obj,a046,dt))
        a046.add_updater(lambda obj,dt:move(obj,a047,dt))
        a047.add_updater(lambda obj,dt:move(obj,a048,dt))
        a048.add_updater(lambda obj,dt:move(obj,a049,dt))
        a049.add_updater(lambda obj,dt:move(obj,a050,dt))
        a050.add_updater(lambda obj,dt:move(obj,a051,dt))
        a051.add_updater(lambda obj,dt:move(obj,a052,dt))
        a052.add_updater(lambda obj,dt:move(obj,a053,dt))
        a053.add_updater(lambda obj,dt:move(obj,a054,dt))
        a054.add_updater(lambda obj,dt:move(obj,a055,dt))
        a055.add_updater(lambda obj,dt:move(obj,a056,dt))
        a056.add_updater(lambda obj,dt:move(obj,a057,dt))
        a057.add_updater(lambda obj,dt:move(obj,a058,dt))
        a058.add_updater(lambda obj,dt:move(obj,a059,dt))
        a059.add_updater(lambda obj,dt:move(obj,a060,dt))
        a060.add_updater(lambda obj,dt:move(obj,a061,dt))
        a061.add_updater(lambda obj,dt:move(obj,a062,dt))
        a062.add_updater(lambda obj,dt:move(obj,a063,dt))
        a063.add_updater(lambda obj,dt:move(obj,a064,dt))
        a064.add_updater(lambda obj,dt:move(obj,a065,dt))
        a065.add_updater(lambda obj,dt:move(obj,a066,dt))
        a066.add_updater(lambda obj,dt:move(obj,a067,dt))
        a067.add_updater(lambda obj,dt:move(obj,a068,dt))
        a068.add_updater(lambda obj,dt:move(obj,a069,dt))
        a069.add_updater(lambda obj,dt:move(obj,a070,dt))
        a070.add_updater(lambda obj,dt:move(obj,a071,dt))
        a071.add_updater(lambda obj,dt:move(obj,a072,dt))
        a072.add_updater(lambda obj,dt:move(obj,a073,dt))
        a073.add_updater(lambda obj,dt:move(obj,a074,dt))
        a074.add_updater(lambda obj,dt:move(obj,a075,dt))
        a075.add_updater(lambda obj,dt:move(obj,a076,dt))
        a076.add_updater(lambda obj,dt:move(obj,a077,dt))
        a077.add_updater(lambda obj,dt:move(obj,a078,dt))
        a078.add_updater(lambda obj,dt:move(obj,a079,dt))
        a079.add_updater(lambda obj,dt:move(obj,a080,dt))
        a080.add_updater(lambda obj,dt:move(obj,a081,dt))
        a081.add_updater(lambda obj,dt:move(obj,a082,dt))
        a082.add_updater(lambda obj,dt:move(obj,a083,dt))
        a083.add_updater(lambda obj,dt:move(obj,a084,dt))
        a084.add_updater(lambda obj,dt:move(obj,a085,dt))
        a085.add_updater(lambda obj,dt:move(obj,a086,dt))
        a086.add_updater(lambda obj,dt:move(obj,a087,dt))
        a087.add_updater(lambda obj,dt:move(obj,a088,dt))
        a088.add_updater(lambda obj,dt:move(obj,a089,dt))
        a089.add_updater(lambda obj,dt:move(obj,a090,dt))
        a090.add_updater(lambda obj,dt:move(obj,a091,dt))
        a091.add_updater(lambda obj,dt:move(obj,a092,dt))
        a092.add_updater(lambda obj,dt:move(obj,a093,dt))
        a093.add_updater(lambda obj,dt:move(obj,a094,dt))
        a094.add_updater(lambda obj,dt:move(obj,a095,dt))
        a095.add_updater(lambda obj,dt:move(obj,a096,dt))
        a096.add_updater(lambda obj,dt:move(obj,a097,dt))
        a097.add_updater(lambda obj,dt:move(obj,a098,dt))
        a098.add_updater(lambda obj,dt:move(obj,a099,dt))
        a099.add_updater(lambda obj,dt:move(obj,a00,dt))
        a10.add_updater(lambda obj:obj.put_start_and_end_on(a00.get_center(),a01.get_center()))
        a11.add_updater(lambda obj:obj.put_start_and_end_on(a01.get_center(),a02.get_center()))
        a12.add_updater(lambda obj:obj.put_start_and_end_on(a02.get_center(),a03.get_center()))
        a13.add_updater(lambda obj:obj.put_start_and_end_on(a03.get_center(),a04.get_center()))
        a14.add_updater(lambda obj:obj.put_start_and_end_on(a04.get_center(),a05.get_center()))
        a15.add_updater(lambda obj:obj.put_start_and_end_on(a05.get_center(),a06.get_center()))
        a16.add_updater(lambda obj:obj.put_start_and_end_on(a06.get_center(),a07.get_center()))
        a17.add_updater(lambda obj:obj.put_start_and_end_on(a07.get_center(),a08.get_center()))
        a18.add_updater(lambda obj:obj.put_start_and_end_on(a08.get_center(),a09.get_center()))
        a19.add_updater(lambda obj:obj.put_start_and_end_on(a09.get_center(),a010.get_center()))
        a110.add_updater(lambda obj:obj.put_start_and_end_on(a010.get_center(),a011.get_center()))
        a111.add_updater(lambda obj:obj.put_start_and_end_on(a011.get_center(),a012.get_center()))
        a112.add_updater(lambda obj:obj.put_start_and_end_on(a012.get_center(),a013.get_center()))
        a113.add_updater(lambda obj:obj.put_start_and_end_on(a013.get_center(),a014.get_center()))
        a114.add_updater(lambda obj:obj.put_start_and_end_on(a014.get_center(),a015.get_center()))
        a115.add_updater(lambda obj:obj.put_start_and_end_on(a015.get_center(),a016.get_center()))
        a116.add_updater(lambda obj:obj.put_start_and_end_on(a016.get_center(),a017.get_center()))
        a117.add_updater(lambda obj:obj.put_start_and_end_on(a017.get_center(),a018.get_center()))
        a118.add_updater(lambda obj:obj.put_start_and_end_on(a018.get_center(),a019.get_center()))
        a119.add_updater(lambda obj:obj.put_start_and_end_on(a019.get_center(),a020.get_center()))
        a120.add_updater(lambda obj:obj.put_start_and_end_on(a020.get_center(),a021.get_center()))
        a121.add_updater(lambda obj:obj.put_start_and_end_on(a021.get_center(),a022.get_center()))
        a122.add_updater(lambda obj:obj.put_start_and_end_on(a022.get_center(),a023.get_center()))
        a123.add_updater(lambda obj:obj.put_start_and_end_on(a023.get_center(),a024.get_center()))
        a124.add_updater(lambda obj:obj.put_start_and_end_on(a024.get_center(),a025.get_center()))
        a125.add_updater(lambda obj:obj.put_start_and_end_on(a025.get_center(),a026.get_center()))
        a126.add_updater(lambda obj:obj.put_start_and_end_on(a026.get_center(),a027.get_center()))
        a127.add_updater(lambda obj:obj.put_start_and_end_on(a027.get_center(),a028.get_center()))
        a128.add_updater(lambda obj:obj.put_start_and_end_on(a028.get_center(),a029.get_center()))
        a129.add_updater(lambda obj:obj.put_start_and_end_on(a029.get_center(),a030.get_center()))
        a130.add_updater(lambda obj:obj.put_start_and_end_on(a030.get_center(),a031.get_center()))
        a131.add_updater(lambda obj:obj.put_start_and_end_on(a031.get_center(),a032.get_center()))
        a132.add_updater(lambda obj:obj.put_start_and_end_on(a032.get_center(),a033.get_center()))
        a133.add_updater(lambda obj:obj.put_start_and_end_on(a033.get_center(),a034.get_center()))
        a134.add_updater(lambda obj:obj.put_start_and_end_on(a034.get_center(),a035.get_center()))
        a135.add_updater(lambda obj:obj.put_start_and_end_on(a035.get_center(),a036.get_center()))
        a136.add_updater(lambda obj:obj.put_start_and_end_on(a036.get_center(),a037.get_center()))
        a137.add_updater(lambda obj:obj.put_start_and_end_on(a037.get_center(),a038.get_center()))
        a138.add_updater(lambda obj:obj.put_start_and_end_on(a038.get_center(),a039.get_center()))
        a139.add_updater(lambda obj:obj.put_start_and_end_on(a039.get_center(),a040.get_center()))
        a140.add_updater(lambda obj:obj.put_start_and_end_on(a040.get_center(),a041.get_center()))
        a141.add_updater(lambda obj:obj.put_start_and_end_on(a041.get_center(),a042.get_center()))
        a142.add_updater(lambda obj:obj.put_start_and_end_on(a042.get_center(),a043.get_center()))
        a143.add_updater(lambda obj:obj.put_start_and_end_on(a043.get_center(),a044.get_center()))
        a144.add_updater(lambda obj:obj.put_start_and_end_on(a044.get_center(),a045.get_center()))
        a145.add_updater(lambda obj:obj.put_start_and_end_on(a045.get_center(),a046.get_center()))
        a146.add_updater(lambda obj:obj.put_start_and_end_on(a046.get_center(),a047.get_center()))
        a147.add_updater(lambda obj:obj.put_start_and_end_on(a047.get_center(),a048.get_center()))
        a148.add_updater(lambda obj:obj.put_start_and_end_on(a048.get_center(),a049.get_center()))
        a149.add_updater(lambda obj:obj.put_start_and_end_on(a049.get_center(),a050.get_center()))
        a150.add_updater(lambda obj:obj.put_start_and_end_on(a050.get_center(),a051.get_center()))
        a151.add_updater(lambda obj:obj.put_start_and_end_on(a051.get_center(),a052.get_center()))
        a152.add_updater(lambda obj:obj.put_start_and_end_on(a052.get_center(),a053.get_center()))
        a153.add_updater(lambda obj:obj.put_start_and_end_on(a053.get_center(),a054.get_center()))
        a154.add_updater(lambda obj:obj.put_start_and_end_on(a054.get_center(),a055.get_center()))
        a155.add_updater(lambda obj:obj.put_start_and_end_on(a055.get_center(),a056.get_center()))
        a156.add_updater(lambda obj:obj.put_start_and_end_on(a056.get_center(),a057.get_center()))
        a157.add_updater(lambda obj:obj.put_start_and_end_on(a057.get_center(),a058.get_center()))
        a158.add_updater(lambda obj:obj.put_start_and_end_on(a058.get_center(),a059.get_center()))
        a159.add_updater(lambda obj:obj.put_start_and_end_on(a059.get_center(),a060.get_center()))
        a160.add_updater(lambda obj:obj.put_start_and_end_on(a060.get_center(),a061.get_center()))
        a161.add_updater(lambda obj:obj.put_start_and_end_on(a061.get_center(),a062.get_center()))
        a162.add_updater(lambda obj:obj.put_start_and_end_on(a062.get_center(),a063.get_center()))
        a163.add_updater(lambda obj:obj.put_start_and_end_on(a063.get_center(),a064.get_center()))
        a164.add_updater(lambda obj:obj.put_start_and_end_on(a064.get_center(),a065.get_center()))
        a165.add_updater(lambda obj:obj.put_start_and_end_on(a065.get_center(),a066.get_center()))
        a166.add_updater(lambda obj:obj.put_start_and_end_on(a066.get_center(),a067.get_center()))
        a167.add_updater(lambda obj:obj.put_start_and_end_on(a067.get_center(),a068.get_center()))
        a168.add_updater(lambda obj:obj.put_start_and_end_on(a068.get_center(),a069.get_center()))
        a169.add_updater(lambda obj:obj.put_start_and_end_on(a069.get_center(),a070.get_center()))
        a170.add_updater(lambda obj:obj.put_start_and_end_on(a070.get_center(),a071.get_center()))
        a171.add_updater(lambda obj:obj.put_start_and_end_on(a071.get_center(),a072.get_center()))
        a172.add_updater(lambda obj:obj.put_start_and_end_on(a072.get_center(),a073.get_center()))
        a173.add_updater(lambda obj:obj.put_start_and_end_on(a073.get_center(),a074.get_center()))
        a174.add_updater(lambda obj:obj.put_start_and_end_on(a074.get_center(),a075.get_center()))
        a175.add_updater(lambda obj:obj.put_start_and_end_on(a075.get_center(),a076.get_center()))
        a176.add_updater(lambda obj:obj.put_start_and_end_on(a076.get_center(),a077.get_center()))
        a177.add_updater(lambda obj:obj.put_start_and_end_on(a077.get_center(),a078.get_center()))
        a178.add_updater(lambda obj:obj.put_start_and_end_on(a078.get_center(),a079.get_center()))
        a179.add_updater(lambda obj:obj.put_start_and_end_on(a079.get_center(),a080.get_center()))
        a180.add_updater(lambda obj:obj.put_start_and_end_on(a080.get_center(),a081.get_center()))
        a181.add_updater(lambda obj:obj.put_start_and_end_on(a081.get_center(),a082.get_center()))
        a182.add_updater(lambda obj:obj.put_start_and_end_on(a082.get_center(),a083.get_center()))
        a183.add_updater(lambda obj:obj.put_start_and_end_on(a083.get_center(),a084.get_center()))
        a184.add_updater(lambda obj:obj.put_start_and_end_on(a084.get_center(),a085.get_center()))
        a185.add_updater(lambda obj:obj.put_start_and_end_on(a085.get_center(),a086.get_center()))
        a186.add_updater(lambda obj:obj.put_start_and_end_on(a086.get_center(),a087.get_center()))
        a187.add_updater(lambda obj:obj.put_start_and_end_on(a087.get_center(),a088.get_center()))
        a188.add_updater(lambda obj:obj.put_start_and_end_on(a088.get_center(),a089.get_center()))
        a189.add_updater(lambda obj:obj.put_start_and_end_on(a089.get_center(),a090.get_center()))
        a190.add_updater(lambda obj:obj.put_start_and_end_on(a090.get_center(),a091.get_center()))
        a191.add_updater(lambda obj:obj.put_start_and_end_on(a091.get_center(),a092.get_center()))
        a192.add_updater(lambda obj:obj.put_start_and_end_on(a092.get_center(),a093.get_center()))
        a193.add_updater(lambda obj:obj.put_start_and_end_on(a093.get_center(),a094.get_center()))
        a194.add_updater(lambda obj:obj.put_start_and_end_on(a094.get_center(),a095.get_center()))
        a195.add_updater(lambda obj:obj.put_start_and_end_on(a095.get_center(),a096.get_center()))
        a196.add_updater(lambda obj:obj.put_start_and_end_on(a096.get_center(),a097.get_center()))
        a197.add_updater(lambda obj:obj.put_start_and_end_on(a097.get_center(),a098.get_center()))
        a198.add_updater(lambda obj:obj.put_start_and_end_on(a098.get_center(),a099.get_center()))
        a199.add_updater(lambda obj:obj.put_start_and_end_on(a099.get_center(),a00.get_center()))
        a20.add_updater(lambda obj:obj.put_start_and_end_on(a10.get_start(),a10.get_start()+a10.get_unit_vector()))
        a21.add_updater(lambda obj:obj.put_start_and_end_on(a11.get_start(),a11.get_start()+a11.get_unit_vector()))
        a22.add_updater(lambda obj:obj.put_start_and_end_on(a12.get_start(),a12.get_start()+a12.get_unit_vector()))
        a23.add_updater(lambda obj:obj.put_start_and_end_on(a13.get_start(),a13.get_start()+a13.get_unit_vector()))
        a24.add_updater(lambda obj:obj.put_start_and_end_on(a14.get_start(),a14.get_start()+a14.get_unit_vector()))
        a25.add_updater(lambda obj:obj.put_start_and_end_on(a15.get_start(),a15.get_start()+a15.get_unit_vector()))
        a26.add_updater(lambda obj:obj.put_start_and_end_on(a16.get_start(),a16.get_start()+a16.get_unit_vector()))
        a27.add_updater(lambda obj:obj.put_start_and_end_on(a17.get_start(),a17.get_start()+a17.get_unit_vector()))
        a28.add_updater(lambda obj:obj.put_start_and_end_on(a18.get_start(),a18.get_start()+a18.get_unit_vector()))
        a29.add_updater(lambda obj:obj.put_start_and_end_on(a19.get_start(),a19.get_start()+a19.get_unit_vector()))
        a210.add_updater(lambda obj:obj.put_start_and_end_on(a110.get_start(),a110.get_start()+a110.get_unit_vector()))
        a211.add_updater(lambda obj:obj.put_start_and_end_on(a111.get_start(),a111.get_start()+a111.get_unit_vector()))
        a212.add_updater(lambda obj:obj.put_start_and_end_on(a112.get_start(),a112.get_start()+a112.get_unit_vector()))
        a213.add_updater(lambda obj:obj.put_start_and_end_on(a113.get_start(),a113.get_start()+a113.get_unit_vector()))
        a214.add_updater(lambda obj:obj.put_start_and_end_on(a114.get_start(),a114.get_start()+a114.get_unit_vector()))
        a215.add_updater(lambda obj:obj.put_start_and_end_on(a115.get_start(),a115.get_start()+a115.get_unit_vector()))
        a216.add_updater(lambda obj:obj.put_start_and_end_on(a116.get_start(),a116.get_start()+a116.get_unit_vector()))
        a217.add_updater(lambda obj:obj.put_start_and_end_on(a117.get_start(),a117.get_start()+a117.get_unit_vector()))
        a218.add_updater(lambda obj:obj.put_start_and_end_on(a118.get_start(),a118.get_start()+a118.get_unit_vector()))
        a219.add_updater(lambda obj:obj.put_start_and_end_on(a119.get_start(),a119.get_start()+a119.get_unit_vector()))
        a220.add_updater(lambda obj:obj.put_start_and_end_on(a120.get_start(),a120.get_start()+a120.get_unit_vector()))
        a221.add_updater(lambda obj:obj.put_start_and_end_on(a121.get_start(),a121.get_start()+a121.get_unit_vector()))
        a222.add_updater(lambda obj:obj.put_start_and_end_on(a122.get_start(),a122.get_start()+a122.get_unit_vector()))
        a223.add_updater(lambda obj:obj.put_start_and_end_on(a123.get_start(),a123.get_start()+a123.get_unit_vector()))
        a224.add_updater(lambda obj:obj.put_start_and_end_on(a124.get_start(),a124.get_start()+a124.get_unit_vector()))
        a225.add_updater(lambda obj:obj.put_start_and_end_on(a125.get_start(),a125.get_start()+a125.get_unit_vector()))
        a226.add_updater(lambda obj:obj.put_start_and_end_on(a126.get_start(),a126.get_start()+a126.get_unit_vector()))
        a227.add_updater(lambda obj:obj.put_start_and_end_on(a127.get_start(),a127.get_start()+a127.get_unit_vector()))
        a228.add_updater(lambda obj:obj.put_start_and_end_on(a128.get_start(),a128.get_start()+a128.get_unit_vector()))
        a229.add_updater(lambda obj:obj.put_start_and_end_on(a129.get_start(),a129.get_start()+a129.get_unit_vector()))
        a230.add_updater(lambda obj:obj.put_start_and_end_on(a130.get_start(),a130.get_start()+a130.get_unit_vector()))
        a231.add_updater(lambda obj:obj.put_start_and_end_on(a131.get_start(),a131.get_start()+a131.get_unit_vector()))
        a232.add_updater(lambda obj:obj.put_start_and_end_on(a132.get_start(),a132.get_start()+a132.get_unit_vector()))
        a233.add_updater(lambda obj:obj.put_start_and_end_on(a133.get_start(),a133.get_start()+a133.get_unit_vector()))
        a234.add_updater(lambda obj:obj.put_start_and_end_on(a134.get_start(),a134.get_start()+a134.get_unit_vector()))
        a235.add_updater(lambda obj:obj.put_start_and_end_on(a135.get_start(),a135.get_start()+a135.get_unit_vector()))
        a236.add_updater(lambda obj:obj.put_start_and_end_on(a136.get_start(),a136.get_start()+a136.get_unit_vector()))
        a237.add_updater(lambda obj:obj.put_start_and_end_on(a137.get_start(),a137.get_start()+a137.get_unit_vector()))
        a238.add_updater(lambda obj:obj.put_start_and_end_on(a138.get_start(),a138.get_start()+a138.get_unit_vector()))
        a239.add_updater(lambda obj:obj.put_start_and_end_on(a139.get_start(),a139.get_start()+a139.get_unit_vector()))
        a240.add_updater(lambda obj:obj.put_start_and_end_on(a140.get_start(),a140.get_start()+a140.get_unit_vector()))
        a241.add_updater(lambda obj:obj.put_start_and_end_on(a141.get_start(),a141.get_start()+a141.get_unit_vector()))
        a242.add_updater(lambda obj:obj.put_start_and_end_on(a142.get_start(),a142.get_start()+a142.get_unit_vector()))
        a243.add_updater(lambda obj:obj.put_start_and_end_on(a143.get_start(),a143.get_start()+a143.get_unit_vector()))
        a244.add_updater(lambda obj:obj.put_start_and_end_on(a144.get_start(),a144.get_start()+a144.get_unit_vector()))
        a245.add_updater(lambda obj:obj.put_start_and_end_on(a145.get_start(),a145.get_start()+a145.get_unit_vector()))
        a246.add_updater(lambda obj:obj.put_start_and_end_on(a146.get_start(),a146.get_start()+a146.get_unit_vector()))
        a247.add_updater(lambda obj:obj.put_start_and_end_on(a147.get_start(),a147.get_start()+a147.get_unit_vector()))
        a248.add_updater(lambda obj:obj.put_start_and_end_on(a148.get_start(),a148.get_start()+a148.get_unit_vector()))
        a249.add_updater(lambda obj:obj.put_start_and_end_on(a149.get_start(),a149.get_start()+a149.get_unit_vector()))
        a250.add_updater(lambda obj:obj.put_start_and_end_on(a150.get_start(),a150.get_start()+a150.get_unit_vector()))
        a251.add_updater(lambda obj:obj.put_start_and_end_on(a151.get_start(),a151.get_start()+a151.get_unit_vector()))
        a252.add_updater(lambda obj:obj.put_start_and_end_on(a152.get_start(),a152.get_start()+a152.get_unit_vector()))
        a253.add_updater(lambda obj:obj.put_start_and_end_on(a153.get_start(),a153.get_start()+a153.get_unit_vector()))
        a254.add_updater(lambda obj:obj.put_start_and_end_on(a154.get_start(),a154.get_start()+a154.get_unit_vector()))
        a255.add_updater(lambda obj:obj.put_start_and_end_on(a155.get_start(),a155.get_start()+a155.get_unit_vector()))
        a256.add_updater(lambda obj:obj.put_start_and_end_on(a156.get_start(),a156.get_start()+a156.get_unit_vector()))
        a257.add_updater(lambda obj:obj.put_start_and_end_on(a157.get_start(),a157.get_start()+a157.get_unit_vector()))
        a258.add_updater(lambda obj:obj.put_start_and_end_on(a158.get_start(),a158.get_start()+a158.get_unit_vector()))
        a259.add_updater(lambda obj:obj.put_start_and_end_on(a159.get_start(),a159.get_start()+a159.get_unit_vector()))
        a260.add_updater(lambda obj:obj.put_start_and_end_on(a160.get_start(),a160.get_start()+a160.get_unit_vector()))
        a261.add_updater(lambda obj:obj.put_start_and_end_on(a161.get_start(),a161.get_start()+a161.get_unit_vector()))
        a262.add_updater(lambda obj:obj.put_start_and_end_on(a162.get_start(),a162.get_start()+a162.get_unit_vector()))
        a263.add_updater(lambda obj:obj.put_start_and_end_on(a163.get_start(),a163.get_start()+a163.get_unit_vector()))
        a264.add_updater(lambda obj:obj.put_start_and_end_on(a164.get_start(),a164.get_start()+a164.get_unit_vector()))
        a265.add_updater(lambda obj:obj.put_start_and_end_on(a165.get_start(),a165.get_start()+a165.get_unit_vector()))
        a266.add_updater(lambda obj:obj.put_start_and_end_on(a166.get_start(),a166.get_start()+a166.get_unit_vector()))
        a267.add_updater(lambda obj:obj.put_start_and_end_on(a167.get_start(),a167.get_start()+a167.get_unit_vector()))
        a268.add_updater(lambda obj:obj.put_start_and_end_on(a168.get_start(),a168.get_start()+a168.get_unit_vector()))
        a269.add_updater(lambda obj:obj.put_start_and_end_on(a169.get_start(),a169.get_start()+a169.get_unit_vector()))
        a270.add_updater(lambda obj:obj.put_start_and_end_on(a170.get_start(),a170.get_start()+a170.get_unit_vector()))
        a271.add_updater(lambda obj:obj.put_start_and_end_on(a171.get_start(),a171.get_start()+a171.get_unit_vector()))
        a272.add_updater(lambda obj:obj.put_start_and_end_on(a172.get_start(),a172.get_start()+a172.get_unit_vector()))
        a273.add_updater(lambda obj:obj.put_start_and_end_on(a173.get_start(),a173.get_start()+a173.get_unit_vector()))
        a274.add_updater(lambda obj:obj.put_start_and_end_on(a174.get_start(),a174.get_start()+a174.get_unit_vector()))
        a275.add_updater(lambda obj:obj.put_start_and_end_on(a175.get_start(),a175.get_start()+a175.get_unit_vector()))
        a276.add_updater(lambda obj:obj.put_start_and_end_on(a176.get_start(),a176.get_start()+a176.get_unit_vector()))
        a277.add_updater(lambda obj:obj.put_start_and_end_on(a177.get_start(),a177.get_start()+a177.get_unit_vector()))
        a278.add_updater(lambda obj:obj.put_start_and_end_on(a178.get_start(),a178.get_start()+a178.get_unit_vector()))
        a279.add_updater(lambda obj:obj.put_start_and_end_on(a179.get_start(),a179.get_start()+a179.get_unit_vector()))
        a280.add_updater(lambda obj:obj.put_start_and_end_on(a180.get_start(),a180.get_start()+a180.get_unit_vector()))
        a281.add_updater(lambda obj:obj.put_start_and_end_on(a181.get_start(),a181.get_start()+a181.get_unit_vector()))
        a282.add_updater(lambda obj:obj.put_start_and_end_on(a182.get_start(),a182.get_start()+a182.get_unit_vector()))
        a283.add_updater(lambda obj:obj.put_start_and_end_on(a183.get_start(),a183.get_start()+a183.get_unit_vector()))
        a284.add_updater(lambda obj:obj.put_start_and_end_on(a184.get_start(),a184.get_start()+a184.get_unit_vector()))
        a285.add_updater(lambda obj:obj.put_start_and_end_on(a185.get_start(),a185.get_start()+a185.get_unit_vector()))
        a286.add_updater(lambda obj:obj.put_start_and_end_on(a186.get_start(),a186.get_start()+a186.get_unit_vector()))
        a287.add_updater(lambda obj:obj.put_start_and_end_on(a187.get_start(),a187.get_start()+a187.get_unit_vector()))
        a288.add_updater(lambda obj:obj.put_start_and_end_on(a188.get_start(),a188.get_start()+a188.get_unit_vector()))
        a289.add_updater(lambda obj:obj.put_start_and_end_on(a189.get_start(),a189.get_start()+a189.get_unit_vector()))
        a290.add_updater(lambda obj:obj.put_start_and_end_on(a190.get_start(),a190.get_start()+a190.get_unit_vector()))
        a291.add_updater(lambda obj:obj.put_start_and_end_on(a191.get_start(),a191.get_start()+a191.get_unit_vector()))
        a292.add_updater(lambda obj:obj.put_start_and_end_on(a192.get_start(),a192.get_start()+a192.get_unit_vector()))
        a293.add_updater(lambda obj:obj.put_start_and_end_on(a193.get_start(),a193.get_start()+a193.get_unit_vector()))
        a294.add_updater(lambda obj:obj.put_start_and_end_on(a194.get_start(),a194.get_start()+a194.get_unit_vector()))
        a295.add_updater(lambda obj:obj.put_start_and_end_on(a195.get_start(),a195.get_start()+a195.get_unit_vector()))
        a296.add_updater(lambda obj:obj.put_start_and_end_on(a196.get_start(),a196.get_start()+a196.get_unit_vector()))
        a297.add_updater(lambda obj:obj.put_start_and_end_on(a197.get_start(),a197.get_start()+a197.get_unit_vector()))
        a298.add_updater(lambda obj:obj.put_start_and_end_on(a198.get_start(),a198.get_start()+a198.get_unit_vector()))
        a299.add_updater(lambda obj:obj.put_start_and_end_on(a199.get_start(),a199.get_start()+a199.get_unit_vector()))
        print(np.sqrt((a00.get_center()[0]-a01.get_center()[0])**2+(a00.get_center()[1]-a01.get_center()[1])**2)/\
         (1-np.cos(2*PI/100)))
        self.wait(np.sqrt((a00.get_center()[0]-a01.get_center()[0])**2+(a00.get_center()[1]-a01.get_center()[1])**2)/\
         (1-np.cos(2*PI/100)))

class random(Scene):
    def construct(self):
        a=moving(4)
        a00=a[0][0].copy()
        a01=a[0][1].copy()
        a02=a[0][2].copy()
        a03=a[0][3].copy()
        a10=a[1][0].copy()
        a11=a[1][1].copy()
        a12=a[1][2].copy()
        a13=a[1][3].copy()
        a20=a[2][0].copy()
        a21=a[2][1].copy()
        a22=a[2][2].copy()
        a23=a[2][3].copy()
        list=[-1,1]
        Trace=TracedPath(a02.get_center,min_distance_to_new_point=0.01).set_color(RED_A)
        value=ValueTracker(value=list[rd.randint(0,1)])
        
        value.add_updater(lambda obj,dt: obj.set_value(rd.randint(0,1)))
        l00=[a01,a03]
        s00=[a10,a13]
        l01=[a02,a00]
        s01=[a11,a10]
        l02=[a03,a01]
        s02=[a12,a11]
        l03=[a00,a02]
        s03=[a13,a12]
        a00.add_updater(lambda obj,dt:move(obj,l00[int(value.get_value())],dt))
        a01.add_updater(lambda obj,dt:move(obj,l01[int(value.get_value())],dt))
        a02.add_updater(lambda obj,dt:move(obj,l02[int(value.get_value())],dt))
        a03.add_updater(lambda obj,dt:move(obj,l03[int(value.get_value())],dt))
        a10.add_updater(lambda obj:obj.put_start_and_end_on(a00.get_center(),a01.get_center()))
        a11.add_updater(lambda obj:obj.put_start_and_end_on(a01.get_center(),a02.get_center()))
        a12.add_updater(lambda obj:obj.put_start_and_end_on(a02.get_center(),a03.get_center()))
        a13.add_updater(lambda obj:obj.put_start_and_end_on(a03.get_center(),a00.get_center()))
        a20.add_updater(lambda obj:obj.put_start_and_end_on(a10.get_start(),a10.get_start()+int(-value.get_value()*2+1)*s00[int(value.get_value())].get_unit_vector()))
        a21.add_updater(lambda obj:obj.put_start_and_end_on(a11.get_start(),a11.get_start()+int(-value.get_value()*2+1)*s01[int(value.get_value())].get_unit_vector()))
        a22.add_updater(lambda obj:obj.put_start_and_end_on(a12.get_start(),a12.get_start()+int(-value.get_value()*2+1)*s02[int(value.get_value())].get_unit_vector()))
        a23.add_updater(lambda obj:obj.put_start_and_end_on(a13.get_start(),a13.get_start()+int(-value.get_value()*2+1)*s03[int(value.get_value())].get_unit_vector()))
        self.add(a00,a01,a02,a03,a10,a11,a12,a13,a20,a21,a22,a23,value,Trace)
        self.wait(2*1.4)
class opacity(Scene):
    def construct(self):
        circle=Circle()
        self.add(circle)
        self.play(circle.animate.set_fill(color=WHITE,opacity=1))